//-------------------------------------------------------------------
//	Copyright (c) 2010-2012  Zhirnov Andrey
//	This file is part of the "UXGEN" project.
//	See copyright notice in "Engine.h".
//-------------------------------------------------------------------

#ifndef _UX_STATIC_MODEL_H
#define _UX_STATIC_MODEL_H

#include "Geometry.h"
#include "../CResource.h"
#include "../../Systems/Render/CRender.h"

namespace Engine
{
namespace Resources
{

	//
	// Model interface
	//

	class _EXPORT_ IModel : public CResource
	{
	public:
		struct TROParams
		{
			const frustum_t &	sFrustum;
			const mat4 &		sModelMatrix;
			real				tVisDistance;
			///
			TROParams(const frustum_t &fr, const mat4 &m, const real& vd):
				sFrustum(fr), sModelMatrix(m), tVisDistance(vd)
			{}
		};

	protected:
		IModel(const char *pFileName): CResource(pFileName) {}

	public:
		// create render operations
		virtual bool Render(const TROParams &sParams, TCameraRenderQueue *pCRQ) = 0;
		
		// return bounding box
		virtual bool GetBoundingBox(aabb_f &sBBox) = 0;

		// return mesh resource
		virtual bool GetMesh(CResourcePtr &) = 0;

		// return materials array
		virtual bool GetMaterials(array<IMaterialPtr> &) = 0;
	};

//-------------------------------------------------------------------

}	// Resources
}	// Engine

#endif	// _UX_STATIC_MODEL_H